package com.example.demo.dynamicProxy;

import java.lang.reflect.Proxy;

/**
 * Created by alva on 18/6/27.
 */
public class DynamicProxyMain {
    public static void main(String[] args) {
        HelloImpl hello = new HelloImpl();
        DynamicProxyHandler handler = new DynamicProxyHandler(hello);
        Hello proxyHello = (Hello) Proxy.newProxyInstance(HelloImpl.class.getClassLoader(),HelloImpl.class.getInterfaces(),handler);
        proxyHello.sayHello("dingqi");
    }
}
